# -*- coding = utf-8 -*-
# @Time :2024/2/1 12:34
# @Author :invictusQAQ
# @Description :
# @File :  register_page.py
from time import sleep
from selenium.webdriver.common.by import By
from config.config import register_url
from base.base_page import BasePage


class RegisterPage(BasePage):
    username = (By.XPATH, '//*[@id="app"]/div/div/div[2]/label[1]/input')
    password = (By.XPATH, '//*[@id="app"]/div/div/div[2]/label[2]/input')
    confirm_password = (By.XPATH, '//*[@id="app"]/div/div/div[2]/label[3]/input')
    question = (By.XPATH, '//*[@id="app"]/div/div/div[2]/label[4]/input')
    answer = (By.XPATH, '//*[@id="app"]/div/div/div[2]/label[5]/input')
    button = (By.XPATH, '//*[@id="app"]/div/div/div[2]/button')

    def register(self, user, pwd, cnf_pwd, qu, ans):
        self.visit(register_url)
        self.input(self.username, user)
        self.input(self.password, pwd)
        self.input(self.confirm_password, cnf_pwd)
        self.input(self.question, qu)
        self.input(self.answer, ans)
        self.click(self.button)
